﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using BLL;
using System.Text;

public partial class MyLy_MylyTransferPwd : System.Web.UI.Page
{
    BLL.ModifyRegUserPwd modify = new ModifyRegUserPwd();
    protected void Page_Load(object sender, EventArgs e)
    {
          if (Session["LoginUser"] == null)
        {
            Response.Redirect(WebUtility.getWebRootPath() + "/Login/Login.aspx");
        }
          if (!Page.IsPostBack)
          { 
                
          }
    }

    //更改密码
    protected void ImgBtnUpdate_Click1(object sender, ImageClickEventArgs e)
    {
        string originallyPwd = WebUtility.replaceStr(this.Txt_OldPassword.Text.Trim());
        string newPwd = WebUtility.replaceStr(this.Txt_NewPassword.Text.Trim());
        string surePassword = WebUtility.replaceStr(this.Txt_SurePassword.Text.Trim());

        int flag = modify.modifyPwd(Session["LoginUser"].ToString(), originallyPwd, newPwd);
        if (flag == 1)
        {
            this.Lbl_ErrorInfo.Text = "密码修改成功!";
            //ClientScript.RegisterStartupScript(this.GetType(), "", "<script> alert('密码修改成功！')</script>");
            // ClientScript.RegisterStartupScript(this.GetType(), "", "<script> jAlert('密码修改成功！', '提示')</script>");
        }
        else
        {
            this.Lbl_ErrorInfo.Text = "密码修改失败，请检查填写信息!";
        }
       
    }
}
